package com.smh;

/**
 * @author shiminghui
 * @date 2024/10/17 20:54
 * @description: TODO
 */
public class Main {
    public static void main(String[] args) {

        Season spring = Season.SPRING;
        System.out.println(spring);
        MyEnum spring1 = MyEnum.SPRING;
        System.out.println(spring1);
        System.out.println(MyEnum.class.getSuperclass());

        //values方法返回所有枚举值
        MyEnum[] values = MyEnum.values();
        for (MyEnum value : values) {
            System.out.println(value);
        }

        System.out.println("---------------------------");

        //valueOf方法根据枚举值返回枚举对象
        MyEnum spring2 = MyEnum.valueOf("SPRING");
        System.out.println(spring2);

    }


}
